fixed auto_resize bug
authorLars Hamann <lars@gtk.org>
Sun, 3 Jan 1999 17:32:43 +0000 (17:32 +0000)
committerLars Hamann <lars@src.gnome.org>
Sun, 3 Jan 1999 17:32:43 +0000 (17:32 +0000)
Sun Jan  3 17:41:22 1999  Lars Hamann  <lars@gtk.org>

* gtk/gtkctree.c (real_tree_expand): fixed auto_resize bug

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkctree.c

index 4c0ab8506002e0a5c30e4c29609b1064223d0361..370d33338de9381e180e02940e5a92caae4c43fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Jan  3 17:41:22 1999  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (real_tree_expand): fixed auto_resize bug
+
 Sat Jan  2 03:54:30 1999  Tim Janik  <timj@gtk.org>
 
        * gdk/gdk.h (GDK_PRIORITY_EVENTS): make this G_PRIORITY_DEFAULT.
index 4c0ab8506002e0a5c30e4c29609b1064223d0361..370d33338de9381e180e02940e5a92caae4c43fe 100644 (file)
@@ -1,3 +1,7 @@
+Sun Jan  3 17:41:22 1999  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (real_tree_expand): fixed auto_resize bug
+
 Sat Jan  2 03:54:30 1999  Tim Janik  <timj@gtk.org>
 
        * gdk/gdk.h (GDK_PRIORITY_EVENTS): make this G_PRIORITY_DEFAULT.
index 4c0ab8506002e0a5c30e4c29609b1064223d0361..370d33338de9381e180e02940e5a92caae4c43fe 100644 (file)
@@ -1,3 +1,7 @@
+Sun Jan  3 17:41:22 1999  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (real_tree_expand): fixed auto_resize bug
+
 Sat Jan  2 03:54:30 1999  Tim Janik  <timj@gtk.org>
 
        * gdk/gdk.h (GDK_PRIORITY_EVENTS): make this G_PRIORITY_DEFAULT.
index 4c0ab8506002e0a5c30e4c29609b1064223d0361..370d33338de9381e180e02940e5a92caae4c43fe 100644 (file)
@@ -1,3 +1,7 @@
+Sun Jan  3 17:41:22 1999  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (real_tree_expand): fixed auto_resize bug
+
 Sat Jan  2 03:54:30 1999  Tim Janik  <timj@gtk.org>
 
        * gdk/gdk.h (GDK_PRIORITY_EVENTS): make this G_PRIORITY_DEFAULT.
index 4c0ab8506002e0a5c30e4c29609b1064223d0361..370d33338de9381e180e02940e5a92caae4c43fe 100644 (file)
@@ -1,3 +1,7 @@
+Sun Jan  3 17:41:22 1999  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (real_tree_expand): fixed auto_resize bug
+
 Sat Jan  2 03:54:30 1999  Tim Janik  <timj@gtk.org>
 
        * gdk/gdk.h (GDK_PRIORITY_EVENTS): make this G_PRIORITY_DEFAULT.
index 4c0ab8506002e0a5c30e4c29609b1064223d0361..370d33338de9381e180e02940e5a92caae4c43fe 100644 (file)
@@ -1,3 +1,7 @@
+Sun Jan  3 17:41:22 1999  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (real_tree_expand): fixed auto_resize bug
+
 Sat Jan  2 03:54:30 1999  Tim Janik  <timj@gtk.org>
 
        * gdk/gdk.h (GDK_PRIORITY_EVENTS): make this G_PRIORITY_DEFAULT.
index 4c0ab8506002e0a5c30e4c29609b1064223d0361..370d33338de9381e180e02940e5a92caae4c43fe 100644 (file)
@@ -1,3 +1,7 @@
+Sun Jan  3 17:41:22 1999  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkctree.c (real_tree_expand): fixed auto_resize bug
+
 Sat Jan  2 03:54:30 1999  Tim Janik  <timj@gtk.org>
 
        * gdk/gdk.h (GDK_PRIORITY_EVENTS): make this G_PRIORITY_DEFAULT.
index ec02c895c14ec88cd75233ceddd2b8dbebabd0bf..d26e759845b36b0e2055d693e903913400f1f81d 100644 (file)
@@ -2527,7 +2527,7 @@ real_tree_expand (GtkCTree     *ctree,
   work = GTK_CTREE_ROW (node)->children;
   if (work)
     {
-      GList *list;
+      GList *list = (GList *)work;
       gint *cell_width = NULL;
       gint tmp = 0;
       gint row;
@@ -2538,11 +2538,8 @@ real_tree_expand (GtkCTree     *ctree,
          cell_width = g_new0 (gint, clist->columns);
          if (clist->column[ctree->tree_column].auto_resize)
              cell_width[ctree->tree_column] = requisition.width;
-       }
 
-      while (GTK_CTREE_NODE_NEXT (work))
-       {
-         if (visible && !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
+         while (work)
            {
              /* search maximum cell widths of auto_resize columns */
              for (i = 0; i < clist->columns; i++)
@@ -2552,26 +2549,35 @@ real_tree_expand (GtkCTree     *ctree,
                      (clist, &GTK_CTREE_ROW (work)->row, i, &requisition);
                    cell_width[i] = MAX (requisition.width, cell_width[i]);
                  }
-           }
 
-         work = GTK_CTREE_NODE_NEXT (work);
-         tmp++;
+             list = (GList *)work;
+             work = GTK_CTREE_NODE_NEXT (work);
+             tmp++;
+           }
        }
+      else
+       while (work)
+         {
+           list = (GList *)work;
+           work = GTK_CTREE_NODE_NEXT (work);
+           tmp++;
+         }
 
-      list = (GList *)work;
       list->next = (GList *)GTK_CTREE_NODE_NEXT (node);
 
       if (GTK_CTREE_NODE_NEXT (node))
        {
-         list = (GList *)GTK_CTREE_NODE_NEXT (node);
-         list->prev = (GList *)work;
+         GList *tmp_list;
+
+         tmp_list = (GList *)GTK_CTREE_NODE_NEXT (node);
+         tmp_list->prev = list;
        }
       else
-       clist->row_list_end = (GList *)work;
+       clist->row_list_end = list;
 
       list = (GList *)node;
       list->next = (GList *)(GTK_CTREE_ROW (node)->children);
-      
+
       if (visible)
        {
          /* resize auto_resize columns if needed */
@@ -2584,9 +2590,9 @@ real_tree_expand (GtkCTree     *ctree,
          /* update focus_row position */
          row = g_list_position (clist->row_list, (GList *)node);
          if (row < clist->focus_row)
-           clist->focus_row += tmp + 1;
+           clist->focus_row += tmp;
 
-         clist->rows += tmp + 1;
+         clist->rows += tmp;
          CLIST_REFRESH (clist);
        }
     }